# -*- coding: utf-8 -*-
"""
Created on Sun May  2 22:01:27 2021

@author: weixifei
"""
import torch
import random
import numpy as np
import os
     
def seed_torch(seed=1995):

    random.seed(seed)
    os.environ['PYTHONHASHSEED'] = str(seed)
    np.random.seed(seed)
    torch.manual_seed(seed)
    torch.cuda.manual_seed(seed)
    torch.cuda.manual_seed_all(seed) 
    torch.backends.cudnn.benchmark = False
    torch.backends.cudnn.deterministic = True

if __name__ == "__main__":
    seed_torch(seed=100)
